﻿using EasyToHelp.DBFactory;
using EasyToHelp.Entity;
using System;
using System.Collections.Generic;
using System.Text;

namespace EasyToHelp.Service
{
    public class SysUsersService : ISysUsersService
    {
        /// <summary>
        /// 根据用户名和密码获得用户信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public SysUsers GetSysUsers(SysUsers model)
        {

            using (var db = ContextHelper.Context(ContextHelper._connString))
            {
                return db.Query<SysUsers>().Where(x => x.UserName == model.UserName && x.UserPwd == model.UserPwd).FirstOrDefault();
            }
        }
        public List<SysUsers> GetUserList()
        {
            using (var db = ContextHelper.Context(ContextHelper._connString))
            {
                return db.Query<SysUsers>().ToList();
            }
        }
    }
}
